package com.twu.biblioteca;

import com.twu.biblioteca.Data.BooksList;
import com.twu.biblioteca.Data.MoviesList;
import com.twu.biblioteca.IO.IoHandler;

public class BibliotecaApp extends BibliotecaMenu {
    public IoHandler io;
    private LibraryCollection library;
    private String userInput = "";

    public static void main(String[] args) {
        BibliotecaApp biblioteca = new BibliotecaApp();
        biblioteca.start(new IoHandler());
    }

    public void start(IoHandler ioHandler) {
        library = new LibraryCollection(new BooksList().getBooks(), new MoviesList().getMovies());
        this.io = ioHandler;

        BibliotecaMenu.showWelcomeMessage(io);

        while (!userInput.equals("0")) {
            BibliotecaMenu.showMenu(io);
            userInput = this.io.getInput();
            BibliotecaMenu.selectOption(io, library, userInput);
        }

    }
}
